<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <canvas id="can" width="1000" height="800"></canvas>
    <script>
        var ctx = document.getElementById('can').getContext('2d');
        ctx.moveTo(20, 20);
        ctx.lineTo(100, 100);
        ctx.lineTo(300, 20)
        ctx.lineWidth = 20;
        ctx.strokeStyle = "red";
        ctx.lineCap = "round";
        ctx.lineJoin = "round";
        ctx.stroke();
    </script>
</body>

</html>